import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {AppComponent} from './app.component';
import {CourseComponent} from './course/course.component';
import { CreatorComponent } from './creator/creator.component';
import {HomeComponent} from './home/home.component';
import { ManageComponent } from './manage/manage.component';
import { WorkgroundComponent } from './workground/workground.component';

const routes: Routes = [
    {
        path: '',
        redirectTo: '/home',
        pathMatch: 'full'
    }, {
        path: 'home',
        component: HomeComponent
    }, {
        path: 'course/:id',
        component: CourseComponent
    },{
        path: 'creator/:id',
        component: CreatorComponent
    },{
        path: 'manage',
        component: ManageComponent
    },{
        path: 'workground',
        component: WorkgroundComponent
    }
];

@NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule]
})
export class AppRoutingModule {}
